/*
 * @Author: your name
 * @Date: 2021-05-08 09:37:52
 * @LastEditTime: 2021-05-08 09:51:49
 * @LastEditors: Please set LastEditors
 * @Description: In User Settings Edit
 * @FilePath: \after-end\app\resModel\index.js
 */
class BaseModel {
    constructor(data, message) {
        if (typeof data === 'string') {
            this.message = data;
            data = null;
            message = null;
        }
        if (data) {
            this.data = data;
        }
        if (message) {
            this.message = message;
        }
    }
}

class SuccessModel extends BaseModel {
    constructor(data, message) {
        super(data, message);
        this.code = 0;
    }
}

class FailModel extends BaseModel {
    constructor(data, message) {
        super(data, message);
        this.code = -1;
    }
}

module.exports = {
    SuccessModel,
    FailModel
}